Skip to content

Fix documentation for @cmpxchg* functions.#22306

Closed
IntegratedQuantum wants to merge 1 commit into
ziglang:masterfrom
IntegratedQuantum:fix_cmpxchg_documentation
Closed

Fix documentation for @cmpxchg* functions.#22306
IntegratedQuantum wants to merge 1 commit into
ziglang:masterfrom
IntegratedQuantum:fix_cmpxchg_documentation

Conversation

@IntegratedQuantum
Copy link
Copy Markdown
Contributor

The text was incorrectly saying that it returns null in the failure path, if expected != current, but according to the example code below and my intuition it only returns null when the comparison succeeds.

I also decided to simplify the sentence a bit, since the previous sentence structure didn't do a good job at conveying the important piece of information.

The text was incorrectly saying that it returns null in the failure path.
@Rexicon226
Copy link
Copy Markdown
Contributor

btw duplicate of #21755 and #20411

@IntegratedQuantum
Copy link
Copy Markdown
Contributor Author

Oops, my bad, I should have searched for it. (I expected that such a small fix would have been merged within days, not 5 months)

Well, now that it is here, I will leave this PR open as a reminder to the maintainers to please merge a fix for this issue before more people stumble over this. With now 3 options to choose from, there should be no reason to delay this any further.

@alexrp
Copy link
Copy Markdown
Member

alexrp commented Jan 26, 2025

I decided to take #21755 because it was a simpler and more obvious fix that immediately resolves the confusion. I think the docs for these builtins could do with a complete rewrite in the longer term though, not just this one sentence.

In any case, thanks for taking a stab at this!

@alexrp alexrp closed this Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants